-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes several bugs on GNRC network stack #4447
Conversation
Wow, I haven't looked at the changes in detail, but I'd like already thank you for sharing your findings and providing all these fixes! |
Thank you @Yonezawa-T2 ! I will take a look at your proposed fixes. |
#endif | ||
#if defined(MODULE_GNRC_NDP_ROUTER) || defined(MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER) | ||
#if defined(MODULE_GNRC_NDP_ROUTER) || defined(MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER) || defined(MODULE_GNRC_SIXLOWPAN_ND_ROUTER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rtr_adv_timer
is not defined in gnrc_ipv6_nc_t
for MODULE_GNRC_SIXLOWPAN_ND_ROUTER
@cgundogan fixed. |
|
||
gnrc_ipv6_netif_t *if_entry = gnrc_ipv6_netif_get(iface); | ||
|
||
if (if_entry != NULL && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you put each condition in parenthesis?
@Yonezawa-T2 can you also add a While your fix for the infinite prefix loop works for me, it is still possible to run into the same problem if the pktbuf is full and returns without unlocking the mutex. It would block here: https://github.com/RIOT-OS/RIOT/blob/master/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c#L133 |
Updated. |
gnrc_ipv6_netif_t *if_entry = gnrc_ipv6_netif_get(iface); | ||
|
||
if ((if_entry != NULL) && | ||
(if_entry->rtr_adv_msg.content.ptr == (char *) entry)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation (should however fit into 100 cols of the first line).
Sorry for the late review, this PR wasn't on my radar somehow. Thank you for your contributions, but while most fixes you offer are legitimate, there are some that unnecessarily might make the code size bigger or assume things that might not be true in certain situations. |
All my fixes are based on concrete problems I met while running my application (#4448). Those fixes are necessary unless there are better solutions. |
@Yonezawa-T2 Again, thanks a lot for these fixes! For the next time, experience shows that reviewing is a lot faster when PR's are small, so PR'ing even seemingly trivial commits by themselves is usually a good idea. |
@Yonezawa-T2, could you create a new PR and cherry-pick the following commits: The above commits are those that I would ACK immediately. |
@Yonezawa-T2, could you rebase onto current master? |
bec3774
to
48375f0
Compare
Rebased. |
@@ -481,6 +481,7 @@ ipv6_addr_t *gnrc_ipv6_netif_find_addr(kernel_pid_t pid, const ipv6_addr_t *addr | |||
* @param[out] out The reference to the found address on the interface. | |||
* Must be a pointer to NULL on calling and may stay | |||
* unchanged if no match can be found. | |||
* Must not be NULL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this as a @pre
tag instead?
Apart from my last comment I'm fine with the changes. Please squash immediately, maybe there is a change to squeeze this one into the release, too. |
When `gnrc_ndp_node_next_hop_l2addr` cannot resolve L2 address, it creates a temporary neighbor cache entry with interface `KERNEL_PID_UNDEF` (unless the interface is already known) to send a neighbor solicitation. When another packet directed to the same address is going to sent before receiving a neighbor advertisement, `gnrc_sixlowpan_nd_next_hop_l2addr` gets the temporary neighbor cache entry and calls `gnrc_ipv6_netif_get` with `KERNEL_PID_UNDEF`, resulting get a `NULL`. We must check `NULL` before dereference it. FYI, both `gnrc_ndp_node_next_hop_l2addr` and `gnrc_sixlowpan_nd_next_hop_l2addr` are enabled when `gnrc_sixlowpan_border_router_default` module is enabled with `GNRC_NETIF_NUMOF` is greater than 1: gnrc_sixlowpan_border_router_default → gnrc_ipv6_router_default → gnrc_ndp_router (if GNRC_NETIF_NUMOF > 1) → gnrc_ndp_node → gnrc_ndp_node_next_hop_l2addr is called from _next_hop_l2addr gnrc_sixlowpan_border_router_default → gnrc_sixlowpan_nd_border_router → gnrc_sixlowpan_nd_router → gnrc_sixlowpan_nd → gnrc_sixlowpan_nd_next_hop_l2addr is called from _next_hop_l2addr
When ENABLE_DEBUG is 1, `out` is dereferenced unconditionally, but `_parse_options` in `gnrc_rpl_control_messages.c` calls it with NULL. Clarified `out` must not NULL and fixed `_parse_options`.
48375f0
to
cf35763
Compare
Added |
ACK and go as soon as travis is happy. Please provide a backport to |
fixes several bugs on GNRC network stack
This PR fixes several bugs in GNRC network stack.
See commit messages for details.
This PR may or may not be broken by #3622. I will investigate later.
Tested on OS X with modifications of #4443, #4444, #4445, and #4446.